package cn.itcast.zt.api;

import cn.itcast.zt.annos.ApiServer;
import cn.itcast.zt.domain.User;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * created by zhangtian on 2018/7/9
 */
@ApiServer("http://localhost:8080/user")
public interface IUserApi {
    @GetMapping
    public Flux<User> getAllUser();

    @GetMapping("{id}")
    public Mono<User> getUserById(@PathVariable(value = "id") String id) ;

    @DeleteMapping("{id}")
    public Mono<Void> deleteUserById(@PathVariable(value = "id") String id) ;

    @PostMapping
    public Mono<Void> createUser(@RequestBody Mono<User> user) ;
}
